#include <iostream>

using namespace std;

//条件一:是偶数
bool one(int x)
{
    if ((x & 1) == 0) return true;
    return false;
}

//条件二:大于4且不大于12
bool two(int x)
{
    if (x > 4 && x <= 12) return true;
    return false;
}

int main() {
    int x;
    scanf("%d", &x);
    if (one(x) && two(x)) cout << 1;
    else cout << 0;
    cout << " ";
    if (one(x) || two(x)) cout << 1;
    else cout << 0;
    cout << " ";
    if (one(x) != two(x)) cout << 1;
    else cout << 0;
    cout << " ";
    if (!one(x) && !two(x)) cout << 1;
    else cout << 0;
    return 0;
}